<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
    <ui:define name="head">
        <style type="text/css">
            .col-95 {
                width: 95%;
            }

            .col-5 {
                width: 5%;
            }

            .col-label {
                width: 150px;
                text-align: right;
            }

            .col-label2 {
                /*padding-left: 80px;*/
                width: 150px;
                text-align: right;
            }

            .col-input {
                /*width: 180px;*/
                /*text-align: left;*/
            }

            .col-qry1 {
                width: 80%;
            }
        </style>
        <script language="JavaScript" type="text/JavaScript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    event.keyCode = 9;
                }
            }
        </script>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <h:form id="form">
                <p:focus for="billId"/>
                <p:growl id="msgs" showDetail="true"/>
                <p:panel id="qryfields">
                    <h:panelGrid columns="2" cellspacing="5">
                        <h:panelGrid id="inputVchTxn" columns="4" cellspacing="5" cellpadding="0"
                                     columnClasses="col-label,col-input,col-label,col-input">

                            <h:outputLabel value="编号:" style="text-align: right;"/>
                            <p:inputText id="billId" value="#{payinWarrantAction.billId}" style="width: 150px;"
                                         required="true" requiredMessage="请输入缴款书编号！"/>

                            <h:outputLabel value="票据类型:" style="text-align: right;"/>
                            <p:inputText id="voucherType" value="#{payinWarrantAction.voucherType}"
                                         style="width: 150px;" disabled="#{!payinWarrantAction.payable}"/>

                        </h:panelGrid>
                        <h:panelGrid columns="1" cellspacing="5" cellpadding="0" style="margin-left: 300px;"
                                     width="10%">
                            <p:commandButton id="getbtn" style="width:100px;" value="查询"
                                             action="#{payinWarrantAction.onQuery}"
                                             ajax="true"
                                             update="actbtn,msgs,dataPanel,qryfields">
                            </p:commandButton>
                            <p:commandButton id="actbtn" style="width:100px;" value="缴款"
                                             disabled="#{!payinWarrantAction.payable}"
                                             action="#{payinWarrantAction.onPay}"
                                             ajax="true" update="actbtn,msgs,qryfields">
                            </p:commandButton>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="height:18px;text-align:center">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:panel>
                    <h:panelGrid id="dataPanel" columns="1" style="width: 100%;">
                        <h:panelGrid columns="6" cellpadding="0" cellspacing="5" border="0" style="width:100%;"
                                     columnClasses="col-label, col-input, col-label, col-input, col-label, col-input">
                            <h:outputLabel value="缴款书编号:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.billId}"/>
                            <h:outputLabel value="单位代码:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.instCode}"/>
                            <h:outputLabel value="缴款人:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.payerName}"/>
                            <h:outputLabel value="通知日期:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.notifyDate}"/>
                            <h:outputLabel value="最迟日期:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.latestDate}"/>
                            <h:outputLabel value="滞纳金比例:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.overdueRatio}"/>
                            <h:outputLabel value="滞纳金金额:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.overdueAmt}"/>
                            <h:outputLabel value="校验码:"/>
                            <h:outputText value="#{payinWarrantAction.warrantInfo.verifyNo}"/>

                        </h:panelGrid>
                        <p:separator/>
                        <p:dataTable value="#{payinWarrantAction.warrantInfo.items}" var="record" id="itemTable"
                                     emptyMessage="数据记录为空...">

                            <p:column headerText="项目代码" style="text-align:center">
                                <h:outputText value="#{record.prjCode}"/>
                            </p:column>
                            <p:column headerText="计量单位" style="text-align:center">
                                <h:outputText value="#{record.measure}"/>
                            </p:column>
                            <p:column headerText="数量" style="text-align:left">
                                <h:outputText value="#{record.handleNum}"/>
                            </p:column>
                            <p:column headerText="金额" style="text-align:center">
                                <h:outputText value="#{record.txnAmt}"/>
                            </p:column>

                        </p:dataTable>
                    </h:panelGrid>
                </p:panel>
            </h:form>
        </div>
    </ui:define>
</ui:composition>